package org.example.mapper;


import lombok.Data;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.model.User;

import java.util.List;

@Mapper
public interface UserMapper {
    User queryByName(String username,String password);

    //增删改查
    Integer insert(User user);
    Integer update(User user);
    @Delete("delete from t_user where userId=#{id}")
    Integer delete(Integer id);
    @Select("select * from t_user where userId=#{id}")
    User queryById(Integer id);
    //这里不做分页查询了直接全部一查就行了
    @Select("select * from t_user")
    List<User> queryAll();
}
